home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20020314-20021006 / 000385_mswarbrick@rentokil.com_Tue Sep 24 09:14:15 EDT 2002.msg < prev    next >
Text File  |  2020-01-01  |  2KB  |  77 lines

  1. Article: 13721 of comp.protocols.kermit.misc
  2. Path: newsmaster.cc.columbia.edu!panix!bloom-beacon.mit.edu!newsfeed.stanford.edu!postnews1.google.com!not-for-mail
  3. From: mswarbrick@rentokil.com (Mark Swarbrick)
  4. Newsgroups: comp.protocols.kermit.misc
  5. Subject: Re: scripting to a serial sms modem - idiot question!
  6. Date: 24 Sep 2002 04:21:17 -0700
  7. Organization: http://groups.google.com/
  8. Lines: 58
  9. Message-ID: <e516d9ec.0209240321.7d110c63@posting.google.com>
  10. References: <e516d9ec.0209160537.450ca7b@posting.google.com> <am4nq6$p5i$1@watsol.cc.columbia.edu> <e516d9ec.0209180309.320f7dad@posting.google.com> <am9v0g$t1e$1@watsol.cc.columbia.edu> <e516d9ec.0209190043.6a2c8e0d@posting.google.com>
  11. NNTP-Posting-Host: 213.2.60.82
  12. Content-Type: text/plain; charset=ISO-8859-1
  13. Content-Transfer-Encoding: 8bit
  14. X-Trace: posting.google.com 1032866477 25687 127.0.0.1 (24 Sep 2002 11:21:17 GMT)
  15. X-Complaints-To: groups-abuse@google.com
  16. NNTP-Posting-Date: 24 Sep 2002 11:21:17 GMT
  17. Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:13721
  18.  
  19. Hi frank,
  20.  
  21. I've had some more time to work on the sms project. The basic idea is
  22. to allow someone to text commands to the sms modem eg. 'uptime' and a
  23. text message sent back with the uptime. I've ordered the kermit book,
  24. but could use some help in the meantime with strings.
  25.  
  26. So far i've added some comment/psudeocode to what i want the script to
  27. do:
  28.  
  29. ---------
  30.  
  31. #!/usr/bin/kermit
  32.  
  33. ; sets modem init stuff
  34.  
  35. set line /dev/ttyS0
  36. set speed 9600
  37. set carrier-watch off
  38. set input echo on
  39. lineout at
  40. input 20 ok
  41. lineout AT+CMGF=1
  42. input 20 ok
  43.  
  44. ; queries modem for all messages
  45.  
  46. lineout at+cmgs=?
  47. input 20 ok
  48. lineout at+cmgl="ALL"
  49. input 100 ok
  50.  
  51. ; Loops msg by message extracting the number and message text into two
  52. strings
  53. ; $msg $no
  54.  
  55. ; Depending on the text of the message perform external command which
  56. includes
  57. ; modifying the response to fit in 160 chars eg sed / awk etc store
  58. the reply
  59. ; in a string called reply_txt
  60.  
  61. ; Execute the send message sms command using  $no and $reply_txt
  62. strings
  63. ; then loop to next message until there are no more, then delete all
  64. messages
  65. ; from the modems memory
  66.  
  67. ---------
  68.  
  69. Does this sound about right? also how to i run a command and store the
  70. results in a string? in bash i'd just type uptime > uptime.txt. But
  71. can I have a clue how to do it in kermit? Then how to i write that
  72. string to a file?
  73.  
  74. Many thanks for a pointer in the right direction!
  75.  
  76. mark
  77.